<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>植百汇采购单</title>
    <script type="text/javascript" src="${ctxStatic}/plugin/layui2.0/jquery-1.10.2.min.js"></script>
    <%@ include file="/webpage/include/bootstraptable.jsp"%>
    <%@include file="/webpage/include/treeview.jsp" %>
    <%@include file="warehouseForm.jsp" %>
  
    <script>
        var ctx = '${ctx}';
        var id = '${id}';
    </script>

<%--     <script type="text/javascript" src="${ctxStatic}/plugin/layui2.0/layui.js"></script> --%>
  <%--   <link rel="stylesheet" href="${ctxStatic}/plugin/layui2.0/css/layui.css" media="all"> --%>
  <link rel="stylesheet" href="${ctxStatic}/common/css/app-blue.css" media="all"> 
      <style>
    .fixed-table-body {
	    overflow-x: auto;
	    overflow-y: auto;
	    height: auto;
	}
    	.fixed-table-body .card-view .title {
		    font-weight: bold;
		    display: inline-block;
		    min-width: 10%;
		    text-align: left !important;
		}
		
		.panel-body {
	     padding: 15px; 
	}

    </style>
    </head>
	<script src="${ctxStatic}/common/js/sku.js"></script>
    <script src="${ctxStatic}/common/js/jeeplus.js"></script> 
    <body>
		<div class="wrapper wrapper-content">
			<div class="panel panel-primary">
				<div class="panel-body">
					<table id="purchaseDetail"></table>
				</div>
			</div>
		</div>
 </body>
 <script src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.js"></script> 
<script src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"></script>  
<script>
	var createDetailTable = function(id){
		$("#purchaseDetail").bootstrapTable({
			 url: ctx+"/purchase/purchaseOrder/erpInfo?skuId="+id,
	    	 contentType : "application/x-www-form-urlencoded",   //必须有
	    	 striped: true,
	    	 cache: false,
	    	 responseHandler:function(sourceData){
	    		 return {"data":sourceData.body.erpInfo};
	    	 },
	    	 columns: [
	    		 {
	    			 title:'名称：',
	    			 field:'projectName'
	    		 },
	    		 {
	    			 title:'类型：',
	    			 field:'serviceType'
	    		 },
	    		 {
	    			 title:'数量：',
	    			 field:'amount'
	    		 },
	    		 {
	    			 title:'日期：',
	    			 field:'createDate'
	    		 },
	    		 {
	    			 title:' ',
	    			 field:'picUrl',
	    			 formatter:function(value,row,index){
	    				 if(row.picUrl){
	    					 return '<img src='+row.picUrl+' style="float:right;width:60%">';
	    				 }
		               }
	    		 }
	    	 ]
		});
		$('#purchaseDetail').bootstrapTable("toggleView");
	};
	$(function(){
		createDetailTable(id);
	});
</script>
</html>